﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list.aspx.cs" Inherits="nst_joke_list" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script><%--jquery.min1.4.2.js--%>
    <script type="text/javascript">
        function checkAllRecord(){
            var ck = $("#checkAll")[0].checked;
            if(ck){
                $("input[name^=GridView]").each(function(){
                    this.checked = true;
                });
            }else{
                $("input[name^=GridView]").each(function(){
                    this.checked = false;
                });
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="JokeAdd.aspx" target="_blank">添加参数记录</a>
        <br />
        数据库名<asp:TextBox ID="txtDatabaseName" runat="server" Text="SQLiteDatabaseMovie"></asp:TextBox>
        表名<asp:TextBox ID="txtDataTableName" runat="server" Text="UncheckedJoke"></asp:TextBox>
        condition<asp:TextBox ID="txtSiteKindId" runat="server" Text="siteKindId='jokeji_爆笑男女'"></asp:TextBox>
        <asp:Button 
            ID="ButtonRefreshData" runat="server" onclick="ButtonRefreshData_Click" 
            Text="查询数据" ValidationGroup="valid" />
        <br />
        UncheckedJoke 条件 siteKindId='jokeji_爆笑男女' UncheckedJokeHaha365 条件 summary='[现代笑话]'
        <asp:RequiredFieldValidator ID="ReqDB" runat="server" 
            ControlToValidate="txtDatabaseName" ErrorMessage="数据库名" ValidationGroup="valid"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="ReqTable" runat="server" 
            ControlToValidate="txtDataTableName" ErrorMessage="表名" ValidationGroup="valid"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="ReqKind" runat="server" 
            ControlToValidate="txtSiteKindId" ErrorMessage="siteKindId" ValidationGroup="valid"></asp:RequiredFieldValidator>
        <br /><br />
        发布到分类<asp:DropDownList ID="ddlJokeType" runat="server">
            <asp:ListItem Value="51">成人笑话</asp:ListItem>
            <asp:ListItem Value="52">家庭笑话</asp:ListItem>
            <asp:ListItem Value="53">动物笑话</asp:ListItem>
            <asp:ListItem Value="54">社会笑话</asp:ListItem>
            <asp:ListItem Value="55">男女笑话</asp:ListItem>
            <asp:ListItem Value="56">校园笑话</asp:ListItem>
            <asp:ListItem Value="57">职场笑话</asp:ListItem>
            <asp:ListItem Value="58">冷笑话</asp:ListItem>            
        </asp:DropDownList>
        &nbsp;&nbsp;        
        <asp:Button ID="ButtonPublish" runat="server" onclick="ButtonPublish_Click" Text="发布到正式表" />
        
        全部发布到分类<asp:DropDownList ID="ddlAll" runat="server">
            <asp:ListItem Value="51">成人笑话</asp:ListItem>
            <asp:ListItem Value="52">家庭笑话</asp:ListItem>
            <asp:ListItem Value="53">动物笑话</asp:ListItem>
            <asp:ListItem Value="54">社会笑话</asp:ListItem>
            <asp:ListItem Value="55">男女笑话</asp:ListItem>
            <asp:ListItem Value="56">校园笑话</asp:ListItem>
            <asp:ListItem Value="57">职场笑话</asp:ListItem>
            <asp:ListItem Value="58">冷笑话</asp:ListItem>            
        </asp:DropDownList>
<asp:Button ID="ButtonAllPublish" runat="server" onclick="ButtonAllPublish_Click" Text="全部发布到正式表" />
        <asp:Label ID="lblMsg" runat="server"></asp:Label>
<input type="checkbox" id="checkAll" onchange="checkAllRecord();" checked="checked" />
        <asp:GridView ID="GridViewJoke" runat="server" AutoGenerateColumns="False">
            <Columns>                
                <asp:TemplateField HeaderText="选择">
                    <ItemTemplate>                       
                        <asp:CheckBox ID="CheckBoxId" Checked="true" runat="server" Text="选择" />
                    </ItemTemplate>                    
                </asp:TemplateField>
                <asp:BoundField DataField="id" HeaderText="id" />
                <asp:TemplateField HeaderText="title">                   
                    <ItemTemplate>
                        <a target="_blank" href='JokeEdit.aspx?id=<%# Eval("id") %>&table=<%=tableName %>'><%# Eval("title")%></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="siteKindId" HeaderText="siteKindId" />                
                <asp:BoundField DataField="content" HeaderText="content" />                
            </Columns>
        </asp:GridView>
    </div>
    </form>
</body>
</html>
